package com.koala.aideddevsystemmodule.modules.transactional.propagation.controller;

import com.koala.aideddevsystemmodule.modules.transactional.propagation.entity.TransactionalPropagationEntity;
import com.koala.aideddevsystemmodule.modules.transactional.propagation.service.TransactionalPropagationService;
import com.koala.aideddevsystemmodule.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 事务传播行为：
 *      参考：https://mp.weixin.qq.com/s/5m7g1TP17uKAtBfe58A5wQ
 *
 * Create by koala on 2022-08-20 21:24:33
 */
@RestController
@RequestMapping("/transactionalpropagation")
public class TransactionalPropagationController {
    @Autowired
    private TransactionalPropagationService transactionalPropagationService;

    /**
     * 本地事务失效问题
     */
    @RequestMapping("/save")
    public R save(@RequestBody TransactionalPropagationEntity transactionalPropagation){
		transactionalPropagationService.saveEntity(transactionalPropagation);

		return R.ok();
    }

}
